package pri.lt.dao;

import com.quark.common.entity.Label;
import com.quark.common.entity.Posts;
import com.quark.common.entity.User;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import pri.lt.entity.FetchHistory;

import java.util.List;

@Repository
public interface FetchHistoryDao extends JpaRepository<FetchHistory,Integer> ,JpaSpecificationExecutor {

    @Cacheable
    @Override
    List<FetchHistory> findAll();

    @Query(value = "from FetchHistory u where u.originUrl=?1")
    List<FetchHistory> findByUrl(String url);
}
